The invention relates to the automotive industry in general, and more specifically to industrial vehicles with braking systems using pneumatic means. The invention is concerned more precisely with a method of controlling the air compressor which is driven by the engine of the vehicle and which supplies the compressed-air reservoir(s). The method according to the invention makes it possible in particular to optimize the production of compressed air notably as a function of the different modes in which the vehicle is operated.